package com.catchpig.fund.domain.network

import com.catchpig.mvvm.network.data.IResponseData
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import kotlinx.serialization.json.JsonElement

@Serializable
data class Result(val data: JsonElement?, @SerialName("result_code") val code: Int) :
    IResponseData<JsonElement> {
    companion object {
        const val CODE_SUCCESS = 0
    }

    override fun data(): JsonElement? {
        return data
    }

    override fun getErrorCode(): String {
        return "$code"
    }

    override fun getErrorMessage(): String {
        return ""
    }

    override fun isSuccess(): String {
        return "$CODE_SUCCESS"
    }
}